<?php
defined('BASEPATH') OR exit('No direct script access allowed');


use QCloud_WeApp_SDK\Mysql\Mysql as DB;


class Test extends CI_Controller
{
    public function index()
    {
        $postArray ='[{"data":{"hello":"world"},"type":"1234","date":"2012-10-30 17:6:9","user":"000000000000000","time_stamp":1351587969902}, {"data":{"hello":"world"},"type":"1234","date":"2012-10-30 17:12:53","user":"000000000000000","time_stamp":1351588373519}]';
        $testArray ='[{
		"goods_id": "53",
		"goods_name": "茅台镇原浆酒4箱  1499元",
		"price": "1499.00",
		"num": 2,
		"pic": "http://7xlub7.com1.z0.glb.clouddn.com/2017-12-06_5a27c44816eb7.png"
	}]';


        $de_json = json_decode($testArray,TRUE);
        $count_json = count($de_json);
        for ($i = 0; $i < $count_json; $i++)
        {
            $dt_record = $de_json[$i]['goods_name'];
//            $data_type = $de_json[$i]['type'];
//            $imei = $de_json[$i]['user'];
//            $message = json_encode($de_json[$i]['data']);

            echo $dt_record;
        }

    }
}
